package com.smarth.zhizulian.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.smarth.zhizulian.R;
import com.smarth.zhizulian.app.BaseActivity;
import com.smarth.zhizulian.utils.GlideUtils;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by 18865 on 2017/12/31.
 */

public class QRCodeActivity extends BaseActivity {
    public static final String INTENT_QRCODE = "INTENT_QRCODE";
    @BindView(R.id.iv_qrcode)
    ImageView ivQrcode;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_qrcode);
        ButterKnife.bind(this);
        setTitlebar("二维码收徒", true);
        String qrCode = getIntent().getStringExtra(INTENT_QRCODE);
        GlideUtils.loadQRCode(mContext, qrCode, ivQrcode);
    }

    public static void open(Context context, String qrCode) {
        Intent i = new Intent(context, QRCodeActivity.class);
        i.putExtra(INTENT_QRCODE, qrCode);
        context.startActivity(i);
    }
}
